public class TestDemo {
    public static void main(String[] args) {
        TestBinaryTree testBinaryTree = new TestBinaryTree();
        TestBinaryTree.TreeNode root = testBinaryTree.creteTree();
        testBinaryTree.preOrder(root);
        System.out.println();

        testBinaryTree.inOrder(root);
        System.out.println();

        testBinaryTree.postOrder(root);
        System.out.println();

        System.out.println("=========节点的个数======");

        testBinaryTree.size1(root);

        System.out.println(TestBinaryTree.count);

        System.out.println("=========节点的个数======");
        System.out.println(testBinaryTree.size2(root));

        System.out.println("叶子节点的个数：");
        testBinaryTree.getLeafNodeCount1(root);
        System.out.println(TestBinaryTree.leafCount);


        System.out.println("=============第K层==========");
        System.out.println(testBinaryTree.getKLevelNodeCount(root, 4));

        System.out.println("============查找某个数据========");
        TestBinaryTree.TreeNode ret = testBinaryTree.find(root,'p');
        try {
            System.out.println(ret.val);
        }catch (NullPointerException e) {
            System.out.println("没有你要找的数据！");
            e.printStackTrace();
        }
    }
}
